/*
 * FileInputNodeProperties.h
 *
 *  Created on: 9 May 2014
 *      Author: jozwika
 */

#ifndef FILEINPUTNODEPROPERTIES_H_
#include "Description.h"
#include "InputMessageParsing.h"
#define FILEINPUTNODEPROPERTIES_H_

namespace inte {

class FileInputNodeProperties {
public:
	FileInputNodeProperties();
	virtual ~FileInputNodeProperties();
	const Description& getDescription() const;
	void setDescription(const Description& description);
	enum SuccessAction
	{
		DeleteOnSuccess,
		Archive,	//Move to Atchive Subdirectory (inte_archive)
		TimeArchive	//Add Time Stamp and Move to Atchive Subdirectory (inte_archive)
	};
	enum Retry
	{
		Failure,
		Short,		//Short Retry
		ShortLong	//Short and Long Retry
	};
	enum FailureAction
	{
		Backup,		//Move to Backup Subdirectory (inte_backup)
		DeleteOnFailure,
		TimeBackup	//Add Time Stamp and Move to Backup Subdirectory (inte_backup)
	};
	enum RecordDetection
	{
		WholeFile,
		FixedLength,
		Delimited

	};
	enum Delimiter
	{
		LineEnd,	//DOS or UNIX line end
		Custom		//Custom delimiter (Hexadecimal)

	};
	enum DelimiterType
	{
		Postfix,	//
		Infix		//

	};
private:
	//Description
	Description description;
	//Basic
	std::string inputDirectory;
	bool ils = false;						//Include local Subdirectories
	std::string pattern = "*";				//File name or pattern
	std::string exPattern = "*";			//File exclusion pattern
	SuccessAction successAction = DeleteOnSuccess;	//Action on successfull processing
	bool replaceArch = false;				//Replace duplicate archive files
	//Input Message Parsing
	InputMessageParsing inputMessageParsing;
	//Polling
	int pollingInerval = 5;					//Polling interval (seconds)
	//Retry
	Retry retry = Failure;
	int retryTreshold = 0;
	int shortRetry = 0;						//Short retry interval (seconds)
	int longRetry = 0;						//Long retry interval (second)
	FailureAction failureActon = Backup;	//Action on failing file
	//Records and Elements
	RecordDetection recordDetection = WholeFile;
	bool skipFirstRecord = false;
	int length = 80;						//Lenght (bytes)
	Delimiter delimiter = LineEnd;
	std::string customDelimiter;			//Custom delimiter (hexadecimal)
	DelimiterType delimiterType = Postfix;
};

} /* namespace inte */

#endif /* FILEINPUTNODEPROPERTIES_H_ */
